package cn.snow.iot.module.warning.api.config;

import cn.snow.iot.module.warning.enums.api.config.AdminConfigApi;
import cn.snow.iot.module.warning.enums.api.config.vo.ConfigCountVO;
import cn.snow.iot.module.warning.service.config.IWarningService;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;


@Validated
@Component
public class AdminConfigApiImpl implements AdminConfigApi {

    @Resource
    private IWarningService warningService;

    @Override
    public List<ConfigCountVO> getWarningCount(List<Long> ids) {
        List<ConfigCountVO> warningCountByEquipmentId = warningService.getWarningCountByEquipmentId(ids);
        return warningCountByEquipmentId;
    }

    @Override
    public boolean deleteByEquipmentId(Long id) {
        boolean status = warningService.deleteByEquipmentId(id);
        return status;
    }
}
